package cn.ieayinfo.train.mybooks.Service;

import cn.ieayinfo.train.mybooks.Entity.User;
import cn.ieayinfo.train.mybooks.Repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;

    public User findByUsername(String username) {
        User user = userRepository.findUserByUsername(username);
        return user;
    }

    public User save(User user) {
        return userRepository.save(user);
    }
}
